package com.qiche.mapper2;

import com.qiche.common.MyMapper;
import com.qiche.dto.MemberCardItemDto;
import com.qiche.model.Card2;
import com.qiche.model.Card2Example;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.special.InsertListMapper;

import java.util.List;
@Mapper
@Repository
public interface Card2Mapper  extends MyMapper<Card2>,InsertListMapper<Card2> {
    Card2 selectActiveByCardId(Long cardId);

    /**
     * 通过 用户手机号 查询 此用户所有
     * @param memberPhone
     * @return
     */
    List<MemberCardItemDto> selectPiccByMemberPhone(@Param("memberPhone")String memberPhone,@Param("sortMoney")String sortMoney,@Param("piccMid")String piccMid);

    int batchInsert(List<Card2> cards);

    /**
     * 根据example 查询卡券和会员信息
     * @param example
     * @return
     */
    List<Card2> selectCardAndMembersByExample(Card2Example example);

   Card2 selectCardAndMemberByCardCode(String cardcode);


}